# -*- coding: utf-8 -*-
"""myFirstDjangoProject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import include, url
from django.contrib import admin

# 引入learn应用包视图
from learn import views as learn_views
from caculator import views as calu_views
from blog import views as blog_views
from tools import views as tools_views


urlpatterns = [
    url(r'^learn/$', learn_views.home),
    url(r'^$', calu_views.index, name='home'),
    url(r'^add/$', calu_views.add, name='add'),
    # name只是起别名的作用，方便M/C的直接调用, 当url发生变化时, 别名未变, 调用的地方就不需要改动！
    # 参考: https://code.ziqiangxuetang.com/django/django-url-name.html
    url(r'^add/(\d+)/(\d+)/$', calu_views.add2, name='add2'),
    url(r'^listpage$', learn_views.list_page, name='listPage'),
    url(r'^admin/', admin.site.urls),
    url(r'^blogadd/$', blog_views.index, name='blogadd'),
    url(r'^tools$', tools_views.index, name='tools'),
    # url(r'^toolsadmin/', include(admin.site.urls)),
]
